:root{
  --t-popup-filter-color-text-alpha-2: rgba(0, 0, 0, 0.8);
  --t-popup-filter-color-text-alpha-3: rgba(0, 0, 0, 0.56);
  --t-popup-filter-color-text-alpha-4: rgba(0, 0, 0, 0.32);
}
.t-popup-filter{
  width: 100%;
}

.t-popup-filter-container {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  overflow-x: auto;
  scrollbar-width: none; /* For Firefox */
  -ms-overflow-style: none; /* For Internet Explorer and Edge */
  background-color: var(--t-popup-filter-bg-color, '#FFF');

  &::-webkit-scrollbar {
    display: none;
  }

  &--hidePopupFilter{
    align-items: unset;
  }

  .t-popup-filter-container-navigation-button{
    display: inline-block;

    .t-popup-filter-container-nav-btn{
      background-color: var(--t-popup-filter-bg-color, '#FFF');
      width: 20px;
      height: 20px;
      line-height: 20px;
      display: inline-block;
      z-index: 1;
      cursor: pointer;

      .q-icon{
        font-size: 12px;
      }

      &.disabled{
        opacity: 0.5;
      }
    }
  }

  .t-popup-filter-container-navigation-filter-button{
    display: inline-block;
    padding-left: 10px;

    &--bg::before{
      content: "";
      position: absolute;
      left: 0;
      top: 0;
      // right: 0;
      bottom: 0;
      width: 6px;
      // z-index: 1000;
      background: linear-gradient(to right, #FCFCFC, #E2E2E2);
    }

    i.q-icon{
      font-size: 14px;
    }
  }

  &--hover{
    background-color: var(--t-popup-filter-bg-color, '#FFF');
  }

  .t-popup-filter-quick {
    // flex-grow: 1;
    flex-shrink: 0;
    // width: 100%;

    display: flex;
    align-items: center;
  }

  .t-popup-filter-button {
    flex-shrink: 0;
    position: sticky;
    right: 0;

    background-color: var(--t-popup-filter-bg-color, '#FFF');
    min-height: 32px;
    line-height: 32px;
  }
}

.t-popup-filter-dialog {
  color: rgba(0, 0, 0, var(--t-color-opacity, 0.8));

  .t-popup-filter-dialog-layout {
    width: 100vw;
    height: 100%;
    flex-direction: column;
    display: flex;
    opacity: 100%;
    background: #ffffff;

    .t-popup-filter-dialog-header {
      flex-direction: row;
      justify-content: center;
      align-items: center;
      display: flex;
      padding-top: 16px;
      padding-left: 24px;
      padding-right: 24px;

      &--title{
        font-size: 16px;
        font-weight: bold;
      }
    }

    .t-popup-filter-dialog-body {
      $padding-lr: 16px;
      flex-direction: column;
      display: flex;
      flex: 1;
      padding: 16px $padding-lr;
      row-gap: 5px;

      /* 方法可行
      --t-popup-filter-dialog-body-padding: $padding-lr;
      padding: 16px var(--t-popup-filter-dialog-body-padding);
      */

      .t-popup-filter-dialog-body-toolbar {
        justify-content: flex-start;
        align-items: center;
        display: flex;
        // flex-wrap: wrap;
        column-gap: 5px;
        // padding-bottom: 12px;
        opacity: 100%;
        border-color: rgba(0, 0, 0, 0.1);
        border-top-width: 0;
        border-left-width: 0;
        border-right-width: 0;
        border-bottom-width: 1px;
        border-style: solid;
        outline: 0 !important;
        color: var(--t-popup-filter-color-text-alpha-3, rgba(0, 0, 0, 0.56));

        .t-popup-filter-default-filter{
          display: flex;
          align-items: center;
          justify-content: flex-start;
          flex: 1;
          column-gap: 5px;
          overflow: hidden;

          .t-popup-filter-default-filter-title{
            width: max-content;
            max-width: 70px;
            flex-shrink: 0;
          }

          .t-popup-filter-default-filter-select{
            flex: 1;
            // max-width: calc(var(--t-popup-filter-dialog-max-width, 100%) - var(--t-popup-filter-dialog-statistics-width,218px));
            overflow: hidden;

            .tr-select-big .q-field__inner .q-field__control {
              border-bottom-width: 0px;

              .q-field__append{
                display: none;
              }
            }
          }
        }

        .t-popup-filter-enable-statistics{
          display: flex;
          align-items: center;
          justify-content: flex-end;
          // flex: 1;
          column-gap: 5px;

          .t-popup-filter-enable-statistics-title{
            width: max-content;
            max-width: 70px;
          }
        }
      }

      .t-popup-filter-dialog-body-fields{
        overflow: hidden hidden;
        flex: 1;

        &--scroll{
          $scroll-p-r: 8px;
          // padding-right: $scroll-p-r;
          margin-right: $scroll-p-r - $padding-lr;
          overflow-y: auto;

          /** 方法可行
          margin-right: calc(8px - var(--t-popup-filter-dialog-body-padding));
          */
        }

        .t-quick-filter {
          .FilterItem.SelectHelper {
            width: 100%;
            .SelectHelper-container {
              flex: 1;

              .t-quick-filter-select-helper.tr-input-default.select_helper_input {
                &.tr-input-form > label {
                  // border-bottom-width: 1px;
                }
              }
            }
          }
        }
      }
    }

    .t-popup-filter-dialog-footer {
      display: flex;
      column-gap: 8px;
      margin: 12px;
      position: static;

      .t-popup-filter-dialog-footer--flex {
        flex: 1;
      }
    }
  }
}

@media screen and (min-width: 768px) {
  .t-popup-filter-dialog {
    --t-popup-filter-dialog-max-width: 328px;
    .t-popup-filter-dialog-layout {
      max-width: var(--t-popup-filter-dialog-max-width) !important;

      .t-popup-filter-dialog-body{
        .t-popup-filter-dialog-body-toolbar{
          padding-bottom: 5px;

          .t-popup-filter-default-filter .t-popup-filter-default-filter-select .tr-select-big .q-field__inner .q-field__control{
            border-bottom-width: 1px;
          }
        }
      }
    }
  }
}

.t-quick-filter-columns {
  &.t-quick-filter {
    &.t-tag-mode-mobile {
      .FilterItem-Desktop {
        height: unset;
        flex-wrap: wrap;
        .FilterItem {
          flex-wrap: wrap;
        }
      }
    }

    .FilterItem-Desktop {
      display: flex;
      flex-direction: column;
      align-items: flex-start;

      /* .t-quick-filter.t-tag-mode-mobile .FilterItem-Desktop .FilterItem */

      .t-quick-filter_chip-group-label {
        width: 100%;
      }

      .FilterItem {
        height: unset;
        .divider {
          display: none;
        }
      }
    }
  }
}
